<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Promise封装 | 11 - catch 方法与异常穿透和值传递</title>
	<script src="./promise.js"></script>
</head>
<body>
	<script>
		// 实例化对象
		let p = new Promise((resolve,reject)=>{
			setTimeout(()=>{
				//resolve('OK')
				reject('error')
			},100)
		})

		// 值传递
		p.then()
		.then(value =>{
			console.log(222)
		}).then(value =>{
			console.log(333)
		}).catch(reason =>{
			console.log(reason);
		})
	</script>
</body>
</html>